<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      isOff: true,
      height: window.innerHeight, //页面高度
    };
  },
  created() {
    //刷新回到默认页面
    if (this.$route.path !== "/") {
      this.$router.replace("/");
    }
  },
  mounted() {
    //防止安卓手机软键盘弹起式撑起页面
    const originalHeight =
      document.documentElement.clientHeight || document.body.clientHeight;
    window.onresize = () => {
      return (() => {
        //键盘弹起与隐藏都会引起窗口的高度发生变化
        const resizeHeight =
          document.documentElement.clientHeight || document.body.clientHeight;
        if (resizeHeight - 0 < originalHeight - 0) {
          //当软键盘弹起，在此处操作
          // console.log("进入到软键盘弹起=========");
          document
            .querySelector("body")
            .setAttribute("style", "height:" + originalHeight + "px;");
          this.scrollerHeight = resizeHeight;
        } else {
          //当软键盘收起，在此处操作
          // console.log("进入到软键盘收起=========");
          document.querySelector("body").setAttribute("style", "height:100%;");
          this.scrollerHeight = "100%";
        }
      })();
    };
  },
};
</script>

<style lang="less">
@font-face {
  font-family: "RidleyRegular";
  src: url("./assets/fonts/RidleyGrotesk-Regular.otf");
}
@font-face {
  font-family: "RidleySemiBold";
  src: url("./assets/fonts/RidleyGrotesk-SemiBold.otf");
}
@font-face {
  font-family: "RidleyBold";
  src: url("./assets/fonts/RidleyGrotesk-Bold.otf");
}
@font-face {
  font-family: "RidleyLight";
  src: url("./assets/fonts/RidleyGrotesk-Light.otf");
}
@font-face {
  font-family: "RidleyMedium";
  src: url("./assets/fonts/RidleyGrotesk-Medium.otf");
}
@font-face {
  font-family: "SourceHanSansCN-Bold";
  src: url("./assets/fonts/SourceHanSansCN-Bold.otf");
}
@font-face {
  font-family: "SourceHanSansCN-Regular";
  src: url("./assets/fonts/SourceHanSansCN-Regular.otf");
}
html,
body {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #ffffff;
  font-size: 16px;
  color: #121212;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  line-height: 1.5;
}
#app {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "RidleyRegular";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
p {
  margin: 0;
}
.clmcenter {
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
}
.clmstart {
  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-start;
  align-items: center;
}
// 最大宽度限制
.maxw {
  max-width: 1200px;
  margin: auto;
}
.toregbtn {
  border-style: none;
  border: 0;
  background: #f18f61;
  font-family: "RidleySemiBold";
  font-size: 1.4rem;
  color: #ffffff;
  padding: 0 5rem;
  line-height: 1.8;
  cursor: pointer;
}
.already {
  font-size: 1rem;
  color: #ffffff;
  text-decoration: underline;
}
.apcbg {
  background-color: rgba(0, 0, 0, 0.7);
}
.btnani {
  animation: btnanito 2s linear infinite;
}
@keyframes btnanito {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
/* 灰度 */
.gray {
  -moz-filter: grayscale(100%);
  -ms-filter: grayscale(100%);
  -o-filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
  // filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0'/></filter></svg>#grayscale");
  // filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
}
/*select和input设置相同大小*/
select,
input {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  border-style: none;
  padding: 0;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
}
select:focus,
input:focus {
  outline: 0;
}
select {
  background: #ffffff url(./assets/img/icon.png) no-repeat right center;
  background-size: 5% auto !important;
  background-position: right 3% top 1rem;
  text-align: center;
  text-align-last: center;
}
select::-ms-expand {
  display: none;
}
/*去除a标签点击时出现闪现黑背景  ——手机端*/
a,
a:hover,
a:active,
a:visited,
a:link,
a:focus,
img {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background: none;
  text-decoration: none;
}
// 禁止选中文本
p,
span,
a,
i,
div {
  -webkit-user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  user-select: none;
}
/* vant样式修改 */
.van-toast {
  width: auto !important;
  font-size: 1.8rem !important;
  padding: 20px !important;
}
.van-toast__text {
  padding: 1rem;
  line-height: 30px;
}
.van-loading__spinner {
  width: 40px !important;
  height: 40px !important;
}
</style>
